package com.example.demo.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 用户登录响应DTO
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserLoginResponseDTO {
    private Integer userId;
    private String usercode;    // 学号/教师工号，用作登录标识
    private String email;
    private String fullName;
    private Boolean isActive;
    private String userType;  // SUPER_ADMIN, TEACHER, STUDENT
    private String message;   // 响应消息，如"教师账号待审核"等
    
    // 组织信息
    private Integer orgId;
    private String orgName;
    private String orgType;
    private String departmentName; // 所属学院名称
    private String majorName;      // 所属系名称
    
    // 用户特定信息
    private StudentInfo studentInfo;  // 如果是学生，则包含学生信息
    private TeacherInfo teacherInfo;  // 如果是教师，则包含教师信息

    private String extraInfo;
    private String token;  // 添加 token 字段

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class StudentInfo {
        private Integer userId;
        // studentCode移除，直接使用usercode字段
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class TeacherInfo {
        private Integer userId;
        // teacherCode移除，直接使用usercode字段
        private String title;
        private String adminRole;  // DEPARTMENT_ADMIN, MAJOR_ADMIN, CLASS_ADMIN
        private String adminRoleStatus;  // 0-待审核, 1-已通过, 2-已拒绝
        private String approvalStatus;   // 0-待审核, 1-已通过, 2-已拒绝
        
        // 提供只有三个参数的构造函数，向后兼容
        public TeacherInfo(Integer userId, String title, String adminRole) {
            this.userId = userId;
            this.title = title;
            this.adminRole = adminRole;
        }
    }
} 